﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Negocio
{
   public class PersistentObject
    {
       private static int ultimoOID;
       private int oID;



       public PersistentObject() 
       {         
            
       }
       
       
       public int OID
        {
            get { return oID; }
            set { oID = value; }
        }

       public int LastOID 
       {
           get { return ultimoOID; }
           set { ultimoOID = value; }
       }
       
        public static int nextOID() 
        {
            ultimoOID = ultimoOID + 1;
            return ultimoOID;
        }
        public void added()
        {
            this.OID = nextOID();
            Club.getPersistence().add(this);
          
        }
        public void updated() {
            Club.getPersistence().update(this);        
        }

        public void removed() 
        {
            Club.getPersistence().delete(this);
        }
        public void recovered() 
        {
            Club.getPersistence().bringData(this);
        }        

    }
}

